<#ftl ns_prefixes={"orm": "http://java.sun.com/xml/ns/persistence/orm"} 
	encoding="UTF-8" /><#recurse doc><#macro "orm:entity-mappings">
	<#global class = .node["orm:entity"].@class />
	<#global package = .node["orm:package"] />
</#macro>package ${package};

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.apache.commons.collections.FactoryUtils;
import org.apache.commons.collections.ListUtils;

import com.googlecode.horncomb.orm.support.paged.PagedSetting;
import com.googlecode.horncomb.web.spring.mvc.ListForm;

/**
 * ${class} list form<br/>
 * <table>
 * <tr>
 * <td>负责人/principal:</td>
 * <td colspan="2"></td>
 * <tr>
 * <td>修改记录/revision:</td>
 * <td colspan="2"></td>
 * </tr>
 * <tr>
 * <td>日期:</td>
 * <td>修改人:</td>
 * <td>修改说明:</td>
 * </tr>
 * <tr>
 * <td></td>
 * <td></td>
 * <td></td>
 * </tr>
 * </table>
 * @author
 * @version $Id$
 */
public class ${class}ListForm implements ListForm
{
    /** 表单事件 */
    private String event = "list";
    /** 分页信息 */
    private Map<String, PagedSetting> pagedSettings = new HashMap<String, PagedSetting>();
    /** 选中的Id */
    private List<String> selectedIds;

    @SuppressWarnings("unchecked")
    public ${class}ListForm()
    {
        super();
        this.selectedIds = ListUtils.lazyList(new ArrayList<String>(),
                FactoryUtils.instantiateFactory(String.class));
    }

    /**
     * {@inheritDoc}
     */
    public PagedSetting getDefaultPagedSetting()
    {
        if (this.pagedSettings.isEmpty())
        {
            return null;
        }
        else
        {
            return this.pagedSettings.values().iterator().next();
        }
    }

    /**
     * {@inheritDoc}
     */
    public Map<String, PagedSetting> getPagedSettings()
    {
        return pagedSettings;
    }

    /**
     * {@inheritDoc}
     */
    public String getEvent()
    {
        return event;
    }

    /**
     * {@inheritDoc}
     */
    public void setEvent(String event)
    {
        this.event = event;
    }

    /**
     * @return the selectedIds
     */
    public List<String> getSelectedIds()
    {
        return selectedIds;
    }

    /**
     * @param selectedIds
     *        the selectedIds to set
     */
    public void setSelectedIds(List<String> selectedIds)
    {
        this.selectedIds = selectedIds;
    }
}